﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.AdminPage
{
    public partial class FrmBannerEdit : WebCommon
    {
        public Model.tb_banner model=new Model.tb_banner();
 
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["Id"]!=null)
                {
                    if (Request.QueryString["Id"].Trim().Length > 0)
                    {
                        GetModel(Convert.ToInt32(Request.QueryString["Id"]));
                    }
                }
               
            }
        }
        public void GetModel(int Id)
        {
            Model.tb_banner data = Common.SqlExption.GetList<Model.tb_banner>().FirstOrDefault(c => c.Id.Equals(Id));


            if (data!=null)
            {
                model = data;
            }
            else
            {
                model.Id = 0;
            }



        }
    }
}
